package com.dcw.lixb.designmode.singleinstance;

/**
 * @author lixiaobin
 * @date 2020-07-16 17:25:21
 * @desc 登记式/静态内部类
 *是否 Lazy 初始化：是
 *
 *是否多线程安全：是
 *
 * 实现难度：一般
 */
public class SingleE {
    public static class SingleEHolder{
        public static final SingleE sInstance = new SingleE();
    }

    private SingleE() {
        try {
            Thread.sleep(200L);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }

    public  static SingleE getInstance() {
        return SingleEHolder.sInstance;
    }
}
